package chapter10;

public class Day04 {
    public static void main(String[] args) {
        int i = 0;
        int j = 0;
        int count=0;
        do {
            i++;
            if (i==1){
                count++;
                System.out.print(i+"  ");
                continue;
            }
            if (count%10==0){
                System.out.println();
            }
            if (count == 1500){
                break;
            }
            j = i;
            while (true){
                if (j%2==0){
                    j/=2 ;
                    continue;
                }else if (j%3==0){
                    j /=3;
                    continue;
                }else if (j%5==0){
                    j /= 5;
                    continue;
                } else if (j==1||j==2||j==5||j==3){
                    count++;

                    break;
                }else {
                    break;
                }
            }
            System.out.print(i+"  ");
        }while (true);
    }
}
